package appconfig

import (
	"fmt"
	"github.com/spf13/viper"
)

type AppConfig struct {
	MysqlInit
	InItRedis
}
type MysqlInit struct {
	Hort string
	User string
	Pass string
	Part int
	Data string
}
type InItRedis struct {
	Addr     string
	Pars     int
	Password string
	DB       int
}

var AppConf AppConfig

func InitApp() {
	viper.SetConfigFile("./appconfig/test.yaml")
	viper.ReadInConfig()
	viper.Unmarshal(&AppConf)
	fmt.Println("动态配置连接成功", AppConf)
}
